package javaBase.nowcoder.HJ100_A_等差数列;

import java.io.*;

public class Main {
    public static void main(String args[]) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        Integer num = Integer.parseInt(br.readLine());
        System.out.println((2 + 3 * (num - 1) + 2) * num / 2);
    }
}
